FreeCntr8
 
 
 Bean FreeCntr8
 
Free running 8-bit counter

Typical usage of the bean in user's code.

Typical Usage:

Required bean name is "FC81".

(1)
It's not reasonable to use the bean for time measurement without any methods. The following code sample measures the time of the for-cycle in microseconds:

 MAIN.C

void main(void)
{
  unsigned char i, time;
  float one_loop_us;
  
  FC81_Reset(); /* reset the counter */
  for( i=0; i<255; ++i ); /* for-cycle */
  
  /* get measured time of whole for-cycle */
  if( FC81_GetTimeUS( &time )==ERR_OK ) { 
  
    /* average time of one loop */
    one_loop_us = time / 255.0; 
  }  
}

For more about typical usage of the bean code please refer to the page Bean Code Typical Usage.


Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.